import static org.junit.Assert.assertTrue;
import msigraphx.graph.BayesianNetwork;
import msigraphx.graph.NetworkVertex;

import org.junit.Before;
import org.junit.Test;


public class ReadNetworkFromFileTest1 {

	BayesianNetwork bayesianNetwork;
	BayesianNetwork bayesianNetworkFromFile;
	
	@Before
	public void setUp() throws Exception {
		TrzesienieZlodziejTest trzesienieZlodziejTest = new TrzesienieZlodziejTest();
		trzesienieZlodziejTest.setUp();
		bayesianNetwork = trzesienieZlodziejTest.bayesianNetwork;
		
		bayesianNetworkFromFile = BayesianNetwork.NetworkFromFileReader.readFromFile("MSIGraphX/trzesienieZlodziej.txt");
		
	}

	@Test
	public void testEquals() {
		for(NetworkVertex vertex : bayesianNetwork.getVertexes().values()) {
			assertTrue(bayesianNetworkFromFile.getVertexes().containsValue(vertex));
			assertTrue(vertex.getChildren().equals(bayesianNetworkFromFile.getVertex(vertex.getName()).getChildren()));
			assertTrue(vertex.getCondDistr().equals(bayesianNetworkFromFile.getVertex(vertex.getName()).getCondDistr()));
		}
	}
}
